package com.zby.admin.pojo;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.dromara.autotable.annotation.AutoColumn;
import org.dromara.autotable.annotation.ColumnComment;
import org.dromara.autotable.annotation.PrimaryKey;

import java.time.LocalDateTime;

@Data
public class BasePojo  {
    @TableId(type = IdType.AUTO)
    @PrimaryKey(autoIncrement = true)
    @ColumnComment("主键id")
    private long id;

    @AutoColumn(notNull = true, comment = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ColumnComment("创建时间")
    private LocalDateTime createTime;

    @AutoColumn(notNull = true, comment = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ColumnComment("更新时间")
    private LocalDateTime updateTime;

    @TableLogic
    @AutoColumn(defaultValue = "0", notNull = true, comment = "0-未删除，1-已删除")
    @ColumnComment("0-未删除，1-已删除")
    private Boolean deleted;

}